from logger import logger

import events
import events.mouse as mouse
import events.key as key

logger.debug("event.py successfully imported events")

import pygame
import state

def handle(e):
	if e.type in (pygame.MOUSEMOTION, pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP):
		mouse.handle(e)
	elif e.type in (pygame.KEYDOWN, pygame.KEYUP):
		key.handle(e)
	elif e.type == pygame.QUIT:
		state.quit = True
		logger.debug("quit event not passed onto a handler; Just quitting.")
	else:
		logger.debug("Non-mouse, keyboard or quit event received - ignoring. Event: " + str(e))
